home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Megahits 5
/
Megahits 5 (1994)(GTI - Rhein-Main-Soft)(DE)(Disc 2 of 2)[!].iso
/
archive
/
show
/
supervlib83dev.lha
/
superview-lib_DEV
/
Programmers
/
Docs
/
SVSupport_Ref_ENG.doc
< prev
next >
Wrap
Text File
|
1994-09-21
|
25KB
|
1,113 lines
$VER: SVSupport_Reference.doc V4.2 (8.7.94)
© 1994 by Andreas R. Kleinert. All rights reserved.
- Feel free to translate this Doc-File into other languages. -
Andreas R. Kleinert,
Grube Hohe Grethe 23,
D-57074 Siegen,
Germany. email : Fido 2:2457/345.10
(checked weekly)
Here is a listing of all currently available functions of the
superviewsupport.library in an Autodoc-like style of description :
SVSUP_GetMemList ; since Version 1
SVSUP_FreeMemList
SVSUP_AddMemEntry
SVSUP_AllocMemEntry
SVSUP_CheckInterleaved
SVSUP_GetXAspect
SVSUP_GetYAspect
SVSUP_GetBitMapDepth
SVSUP_GetBitMapHeight
SVSUP_GetBodySize
SVSUP_GetStdScreenSize
SVSUP_GetBestModeID
SVSUP_CopyScreenToBuffer8 *** OBSOLETE : Use ScreenToOnePlane8
SVSUP_LoadControlPad ; since Version 2
SVSUP_SaveControlPad
SVSUP_FreeControlPad
SVSUP_FindControlPad
SVSUP_BitPlaneToOnePlane8 ; since Version 3
SVSUP_OnePlaneToBitPlane8
SVSUP_ScreenToOnePlane8
SVSUP_ScreenToBitPlane8
SVSUP_DisplayGfxBuffer ; since Version 4
SVSUP_UnDisplayGfxBuffer
SVSUP_FreeGfxBuffer
-----------------------------------------------------------------------------
Functions available since Version 1 :
-----------------------------------------------------------------------------
NAME
SVSUP_GetMemList
SYNOPSIS
APTR SVSUP_GetMemList(void)
D0 -$1e
FUNCTION
Allocates a handle for accessing a memory allocation list.
INPUT(S)
-
RESULT
A pointer to a new allocated Handle or NULL, if allocation failed.
WARNING
Test, if the result was NULL, or not !
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
SVSUP_FreeMemList
-----------------------------------------------------------------------------
NAME
SVSUP_FreeMemList
SYNOPSIS
VOID SVSUP_FreeMemList(APTR handle)
D0 -$24 A1
FUNCTION
Frees all memory from the given memory allocation list
and also delocates the list itself !
INPUT(S)
handle - a valid handle
RESULT
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
SVSUP_GetMemList
-----------------------------------------------------------------------------
NAME
SVSUP_AddMemEntry
SYNOPSIS
ULONG SVSUP_AddMemEntry(APTR handle, APTR pointer)
D0 -$2a A1 A2
FUNCTION
Adds an "AllocVec"ed memory pointer to the memory list,
to be remembered for delocation later.
INPUT(S)
handle - a valid handle
pointer - a pointer to a chunk of memory, which has been
allocated with Exec's AllocVec() function
RESULT
Boolean value : The memory will be freed immediately, if
remembering failed.
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
SVSUP_FreeMemList
-----------------------------------------------------------------------------
NAME
SVSUP_AllocMemEntry
SYNOPSIS
APTR SVSUP_AllocMemEntry(APTR handle, size, type)
D0 -$30 A1 D0 D1
FUNCTION
Allocates memory just like AllocVec(), but remembers this
in the given memory allocation list.
INPUT(S)
handle - a valid handle
size - needed size for the memory chunk
type - "MEMF_"-specification of the memory type
RESULT
pointer to memory or NULL.
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
SVSUP_GetMemList, SVSUP_FreeMemList
-----------------------------------------------------------------------------
NAME
SVSUP_CheckInterleaved
SYNOPSIS
ULONG SVSUP_CheckInterleaved(struct Screen *sc)
D0 -$36 A1
FUNCTION
Is the BitMap of the given Screen of type "interleaved"
(possible since OS V39 with AGA) ?
INPUT(S)
sc - a valid Screen Pointer
RESULT
Boolean value.
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
-
-----------------------------------------------------------------------------
NAME
SVSUP_GetXAspect
SYNOPSIS
UBYTE SVSUP_GetXAspect(struct Screen *sc)
D0 -$3c A1
FUNCTION
Calculates an ILBM compatible XAspect-value for any ScreenMode.
INPUT(S)
sc - a valid Screen Pointer
RESULT
XAspect value for the given Screen.
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
SVSUP_GetXAspect
-----------------------------------------------------------------------------
NAME
SVSUP_GetYAspect
SYNOPSIS
UBYTE SVSUP_GetYAspect(struct Screen *sc)
D0 -$42 A1
FUNCTION
Calculates an ILBM compatible YAspect-value for any ScreenMode.
INPUT(S)
sc - a valid Screen Pointer
RESULT
YAspect value for the given Screen.
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
SVSUP_GetXAspect
-----------------------------------------------------------------------------
NAME
SVSUP_GetBitMapDepth
SYNOPSIS
ULONG SVSUP_GetBitMapDepth(struct Screen *sc)
D0 -$48 A1
FUNCTION
Finds out the depth of the BitMap of a given Screen.
This is safer than accessing the various structures under V39+.
INPUT(S)
sc - a valid Screen Pointer
RESULT
depth of the Screen's BitMap.
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
SVSUP_GetBitMapHeight
-----------------------------------------------------------------------------
NAME
SVSUP_GetBitMapHeight
SYNOPSIS
ULONG SVSUP_GetBitMapHeight(struct Screen *sc)
D0 -$4e A1
FUNCTION
Finds out the height of the BitMap of a given Screen.
This is safer than accessing the various structures under V39+.
INPUT(S)
sc - a valid Screen Pointer
RESULT
height of the Screen's BitMap.
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
SVSUP_GetBitMapDepth
-----------------------------------------------------------------------------
NAME
SVSUP_GetBodySize
SYNOPSIS
ULONG SVSUP_GetBodySize(struct Screen *sc)
D0 -$54 A1
FUNCTION
This function calculates the size of a buffer to hold the
given Screen's BitMap.
As the name reflects, this buffer confirms to the needs
of a "BODY" (or ABIT) chunk for ILBM (or ACBM) Files.
No alignment things are done.
INPUT(S)
sc - a valid Screen Pointer
RESULT
NULL or an adequate SVERR-Errorcode.
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
-
-----------------------------------------------------------------------------
NAME
SVSUP_GetStdScreenSize
SYNOPSIS
ULONG SVSUP_GetStdScreenSize(ULONG mode_id, ULONG *width,
D0 -$5a D0 A1
ULONG *height)
A2
FUNCTION
Gets the standard dimensions for a given ScreenMode.
For e.g. "PAL:HighRes", this would be 640 and 256.
The values are written into the supplied ULONGs.
This function may FAIL !
INPUT(S)
sc - a valid Screen Pointer
RESULT
Boolean value.
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
SVSUP_SuperView
-----------------------------------------------------------------------------
NAME
SVSUP_GetBestModeID
SYNOPSIS
ULONG SVSUP_GetBestModeID(ULONG width, ULONG height, ULONG depth)
D0 -$60 D0 D1 D2
FUNCTION
Returns the best ScreenMode ID for a hypothetical Screen with the
given dimensions.
Under V37 ECS is assumed, under V39 the appropriate Gfx-Library's
function is used for that.
INPUT(S)
width, height, depth - Screen dimension values
RESULT
a ModeID value.
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
-
-----------------------------------------------------------------------------
NAME
SVSUP_CopyScreenToBuffer8 *** OBSOLETE : Use ScreenToOnePlane8
SYNOPSIS
ULONG SVSUP_CopyScreenToBuffer8(struct Screen *sc, UBYTE *buffer,
D0 -$66 A1 A2
ULONG width, ULONG height,
D0 D1
ULONG depth)
D2
FUNCTION
*** You should use SVSUP_ScreenToOnePlane8() instead, which
is more easy to handle and uses this function, anyway ...
This function copies the content of a common Intuition Screen
into a buffer in the "ChunkyPixel" (8 Bit) format.
The buffer itself (with size = width * height) has to be supplied.
The width, height and depth values (depth must be smaller than 8)
have to be supplied also. These are not read from the Screen.
This function may FAIL.
INPUT(S)
sc - a valid ScreenPointer
buffer - a pointer to a buffer with size = width * height
width - Screen's Width
height - Screen's Height
depth - Screen's Depth
RESULT
Boolean value.
BUGS
-
SINCE
... version 1 of the superviewsupport.library.
SEE ALSO
SVSUP_SuperWrite
-----------------------------------------------------------------------------
Functions available since Version 2 :
-----------------------------------------------------------------------------
NAME
SVSUP_LoadControlPad
SYNOPSIS
ULONG SVSUP_LoadControlPad(UBYTE *filename, struct SV_ControlPad **pad)
D0 -$6c A1 A2
FUNCTION
Opens and reads a standard Configuration File for superview.library's
SVObjects, SVDrivers, etc.
It consists of Tooltype-like entries in the form :
<Name>=<Content> or <Keyword>, where each entry is built of one
line of the file.
All lines beginning with "/" or ";" or just blank lines are handled
as comments and are ignored.
All ControlPads are chained in a single-linked List.
Remember to save the head-pointer to the List somewhere,
because it's needed for free'ing the List.
Only READ-ACCESSES should be done to the list entries, but if you
want to add more entries to the list, note that all entries have
to be allocated with AllocVec() and delocated with FreeVec().
INPUT(S)
filename - a FileName for AmigaDOS
pad - a pointer to a ControlPad-Structure pointer
RESULT
Boolean value.
If the function returned FALSE, pad will also be NULL.
BUGS
SVSUP_FindControlPad, SVSUP_SaveControlPad, SVSUP_FreeControlPad
SINCE
... version 2 of the superviewsupport.library.
SEE ALSO
-
-----------------------------------------------------------------------------
NAME
SVSUP_SaveControlPad
SYNOPSIS
ULONG SVSUP_SaveControlPad(UBYTE *filename, struct SV_ControlPad *pad)
D0 -$72 A1 A2
FUNCTION
Writes a standard Configuration File for superview.library's
SVObjects, SVDrivers, etc.
You have to supply your own ControlPad-List (or one supplied from
SVSUP_LoadControlPad).
INPUT(S)
filename - a FileName for AmigaDOS
pad - a pointer to a ControlPad-Structure (List-Head)
RESULT
Boolean value.
BUGS
-
SINCE
... version 2 of the superviewsupport.library.
SEE ALSO
SVSUP_FindControlPad, SVSUP_LoadControlPad, SVSUP_FreeControlPad
-----------------------------------------------------------------------------
NAME
SVSUP_FreeControlPad
SYNOPSIS
ULONG SVSUP_FreeControlPad(struct SV_ControlPad *pad)
D0 -$78 A1
FUNCTION
Frees a single-chained list of ControlPads, which has been
allocated and initialized via SVSUP_LoadControlPad() before.
If you want to free your own, self-created ControlPad lists,
note that all entries have to be allocated with AllocVec() and
delocated with FreeVec().
INPUT(S)
pad - a pointer to a ControlPad-Structure (List-Head)
RESULT
Boolean value.
(returns FALSE when pad is a NULL pointer)
BUGS
-
SINCE
... version 2 of the superviewsupport.library.
SEE ALSO
SVSUP_FindControlPad, SVSUP_SaveControlPad, SVSUP_LoadControlPad
-----------------------------------------------------------------------------
NAME
SVSUP_FindControlPad
SYNOPSIS
ULONG SVSUP_FindControlPad(struct SV_ControlPad *pad,
D0 -$7e A1
UBYTE *name,
A2
UBYTE **content)
A3
FUNCTION
A ControlPad-List consists of Tooltype-like entries in the form :
<Name>=<Content> or <Keyword>.
This function scans through such a list and searches for the
Content of an Entry with a specific name.
For Keywords the result is TRUE, but the Content pointer will
be NULL nevertheless.
Searching IS case-sensitive !
Only READ-ACCESS to the content is allowed.
INPUT(S)
pad - a pointer to a ControlPad-Structure (List-Head)
name - the name of the entry to search for
content - a pointer to a string pointer
(the string pointer will be initialized with a pointer
to the Content or NULL)
RESULT
Boolean value.
BUGS
-
SINCE
... version 2 of the superviewsupport.library.
SEE ALSO
SVSUP_LoadControlPad, SVSUP_SaveControlPad, SVSUP_FreeControlPad
-----------------------------------------------------------------------------
Functions available since Version 3 :
-----------------------------------------------------------------------------
NAME
SVSUP_BitPlaneToOnePlane8
SYNOPSIS
ULONG SVSUP_BitPlaneToOnePlane8(struct SV_GfxBuffer *gfxb,
D0 -$84 A1
struct SV_GfxBuffer **destgfxb)
A2
FUNCTION
This function takes a GfxBuffer of type BITPLANE and creates
a GfxBuffer of type ONEPLANE out of it. This works with upto
8 Bit ColorDepth (256 Colors).
The new GfxBuffer has to be given free by the user.
INPUT(S)
gfx - a pointer to the Source GfxBuffer (BITPLANE)
destgfx - a pointer to a pointer for the Destination
GfxBuffer (ONEPLANE)
RESULT
NULL or a SVERR-Errorcode.
BUGS
-
SINCE
... version 3 of the superviewsupport.library.
SEE ALSO
SVSUP_OnePlaneToBitPlane8
-----------------------------------------------------------------------------
NAME
SVSUP_OnePlaneToBitPlane8
SYNOPSIS
ULONG SVSUP_OnePlaneToBitPlane8(struct SV_GfxBuffer *gfxb,
D0 -$8a A1
struct SV_GfxBuffer **destgfxb)
A2
FUNCTION
This function takes a GfxBuffer of type ONEPLANE and creates
a GfxBuffer of type BITPLANE out of it. This works with upto
8 Bit ColorDepth (256 Colors).
The new GfxBuffer has to be given free by the user.
INPUT(S)
gfx - a pointer to the Source GfxBuffer (ONEPLANE)
destgfx - a pointer to a pointer for the Destination
GfxBuffer (BITPLANE)
RESULT
NULL or a SVERR-Errorcode.
BUGS
-
SINCE
... version 3 of the superviewsupport.library.
SEE ALSO
SVSUP_BitPlaneToOnePlane8
-----------------------------------------------------------------------------
NAME
SVSUP_ScreenToOnePlane8
SYNOPSIS
ULONG SVSUP_ScreenToOnePlane8(struct Screen *sc,
D0 -$90 A1
struct SV_GfxBuffer **destgfxb)
A2
FUNCTION
This function takes an Intuition Screen and creates
a GfxBuffer of type ONEPLANE out of it. This works with upto
8 Bit ColorDepth (256 Colors).
The new GfxBuffer has to be given free by the user.
INPUT(S)
gfx - a pointer to an Intuition Screen
destgfx - a pointer to a pointer for the Destination
GfxBuffer (ONEPLANE)
RESULT
NULL or a SVERR-Errorcode.
BUGS
-
SINCE
... version 3 of the superviewsupport.library.
SEE ALSO
SVSUP_ScreenToBitPlane8
-----------------------------------------------------------------------------
NAME
SVSUP_ScreenToBitPlane8
SYNOPSIS
ULONG SVSUP_ScreenToBitPlane8(struct Screen *sc,
D0 -$96 A1
struct SV_GfxBuffer **destgfxb)
A2
FUNCTION
This function takes an Intuition Screen and creates
a GfxBuffer of type BITPLANE out of it. This works with upto
8 Bit ColorDepth (256 Colors).
The new GfxBuffer has to be given free by the user.
INPUT(S)
gfx - a pointer to an Intuition Screen
destgfx - a pointer to a pointer for the Destination
GfxBuffer (BITPLANE)
RESULT
NULL or a SVERR-Errorcode.
BUGS
-
SINCE
... version 3 of the superviewsupport.library.
SEE ALSO
SVSUP_ScreenToOnePlane8
-----------------------------------------------------------------------------
Functions available since Version 4 :
-----------------------------------------------------------------------------
NAME
SVSUP_DisplayGfxBuffer
SYNOPSIS
ULONG SVSUP_DisplayGfxBuffer(struct SVSUP_DisplayHandle *disphandle)
D0 -$9c A1
FUNCTION
This function allows displaying of GfxBuffers, e.g. for
test-purposes.
This will may you, if you simply want to check the results
of self-created GfxBuffers or compare the results of
a GfxBuffer-conversion via e.g. SVSUP_OnePlaneToBitPlane8.
The following code is quite senseless, because it is much easier
to use SVL_DisplayGfxBuffer() instead, but it demonstrates
quite good, how this function may be used (and _this_ example
definitely works ...) :
ULONG GfxBufferShow(char *filename)
{
ULONG retval = SVERR_NO_ERROR;
APTR handle = N;
struct SVSUP_DisplayHandle *displayhandle = N;
displayhandle = AllocVec(sizeof(struct SVSUP_DisplayHandle), MEMF_CLEAR|MEMF_PUBLIC);
if(displayhandle)
{
SVL_GetGlobalDriver(&displayhandle->SVDriverNode, N);
handle = SVL_AllocHandle(N);
if(handle)
{
if(!(retval = SVL_InitHandleAsDOS(handle, N)))
{
displayhandle->WinIDCMP = IDCMP_MOUSEBUTTONS;
displayhandle->ScrType = CUSTOMSCREEN;
retval = SVL_ReadToGfxBuffer(handle, filename);
if(!retval) retval = SVL_GetGfxBuffer( handle, &displayhandle->SVGfxBuffer, N);
if(!retval && displayhandle->SVGfxBuffer)
{
retval = SVSUP_DisplayGfxBuffer(displayhandle);
if(!retval)
{
if(displayhandle->Window)
{
WaitPort(displayhandle->Window->UserPort);
}
}
SVSUP_UnDisplayGfxBuffer(displayhandle);
}
}
SVL_FreeHandle(handle);
}else retval = SVERR_NO_HANDLE;
FreeVec(displayhandle);
}else retval = SVERR_NO_MEMORY;
return(retval);
}
The Handle has to be allocated and initialized before passing it
to this function. After usage - and after calling SVSUP_UnDisplay-
GfxBuffer() - it has still to be delocated.
You do not need (or must) initialize all fields of the Handle
structure, but set them to NULL, if you do not (or must not).
It is suggested, that you'll use AllocMem/AllocVec() with the
MEMF_CLEAR flag.
Initialize at least the following fields :
- Version (currently 4)
- SVGfxBuffer (the GfxBuffer)
- SVDriverNode (as returned by SVL_GetGlobalDriver)
Optionally initialize the following fields :
- WinIDCMP
- WinFlags
- ScrType
After calling SVSUP_DisplayGfxBuffer(), but before
SVSUP_UnDisplayGfxBuffer() you may use the following fields
for read-only purposes ::
- Window;
- Screen;
All values are used and have to be interpreted just like the
corresponding parameters of the similar SVL_/SVO_ or SVD_
function calls :
If you do not supply values for ScreenType, WindowIDCMP and
WindowFlags, default-values will be used instead.
INPUT(S)
displayhandle - a handle, as defined in "superviewsupport.h".
Has to be allocated and initalized by the User !!
RESULT
NULL or a SVERR-Errorcode.
BUGS
-
SINCE
... version 4 of the superviewsupport.library.
SEE ALSO
SVSUP_UnDisplayGfxBuffer
-----------------------------------------------------------------------------
NAME
SVSUP_UnDisplayGfxBuffer
SYNOPSIS
ULONG SVSUP_UnDisplayGfxBuffer(struct SVSUP_DisplayHandle *disphandle)
D0 -$a2 A1
FUNCTION
This function closes a display, which has been opened via
SVSUP_DisplayGfxBuffer() before.
All temporary buffers etc. will be delocated, then.
The supplied GfxBuffer and the Handle itself will be left intact.
This call requires a valid displayhandle (which has been passed
to SVSUP_DisplayGfxBuffer before).
See SourceCode-example under SVSUP_DisplayGfxBuffer().
INPUT(S)
displayhandle - a handle, as defined in "superviewsupport.h".
Has still to be delocated by the User !!
RESULT
-
BUGS
-
SINCE
... version 4 of the superviewsupport.library.
SEE ALSO
SVSUP_DisplayGfxBuffer
-----------------------------------------------------------------------------
NAME
SVSUP_FreeGfxBuffer
SYNOPSIS
ULONG SVSUP_FreeGfxBuffer(struct SV_GfxBuffer *gfxbuffer)
D0 -$a8 A1
FUNCTION
Use this function to free GfxBuffers, which are not related to
any SVObject-Handles.
E.g. any of the SVSUP_ScreenToXXXPlane() and SVSUP_XXXPlaneToXXXPlane()
functions produce GfxBuffer, which have to be given free either
via separate FreeVec() calls for the ImageData-Buffer and for
the GfxBuffer itself or just by calling this function and then
forgetting about it.
Do not try to free buffers, which will already be freed via the
next SVL_FreeHandle call.
These are Buffers, which are returned by SVL_GetGfxBuffer().
INPUT(S)
gfxbuffer - a valid pointer to a "stand-alone" GfxBuffer
RESULT
-
BUGS
-
SINCE
... version 4 of the superviewsupport.library.
SEE ALSO
SVSUP_ScreenToXXXPlane(), SVSUP_XXXPlaneToXXXPlane()
(XXX = (Bit | One)
-----------------------------------------------------------------------------